xen.git
15 years agoDefine Linux-style <preempt.h> interface.
Keir Fraser [Thu, 18 Nov 2010 11:45:33 +0000 (11:45 +0000)]
Define Linux-style <preempt.h> interface.

Use it to disable sleeping in spinlock and rcu-read regions.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agowaitqueue: Add license info to source file.
Keir Fraser [Thu, 18 Nov 2010 11:44:40 +0000 (11:44 +0000)]
waitqueue: Add license info to source file.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86_64: Fix booting 32-bit dom0
Keir Fraser [Wed, 17 Nov 2010 20:40:30 +0000 (20:40 +0000)]
x86_64: Fix booting 32-bit dom0

dom0/vcpu0 was not getting allocated a hypercall xlat area.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86/hvm/pmtimer: improving scalability of virtual time update
Keir Fraser [Wed, 17 Nov 2010 17:28:17 +0000 (17:28 +0000)]
x86/hvm/pmtimer: improving scalability of virtual time update

Mitigate the heavy contention on handle_pmt_io when running a HVM
configured with many cores (e.g., 32 cores). As the virtual time of a
domain must be fresh, there should be someone updating it,
periodically. But it is not necessary to let a VCPU update the virtual
time when another one has been updating it. Thus the update can be
skipped when the VCPU finds someone else is updating the virtual time.
So every time a VCPU invoke handle_pmt_io to update the current
domain's virtual time, it will first try to acquire the pmtimer lock.
If it succeeds, it will update the virtual time. Otherwise, it can
skip the update, waits for the pmtimer lock holder to finish updating
the virtual time and returns the updated time.

Signed-off-by: Xiang Song <xiangsong@fudan.edu.cn>
Signed-off-by: Keir Fraser <keir@xen.org>
15 years agoWait queues, allowing conditional sleep in hypervisor context.
Keir Fraser [Wed, 17 Nov 2010 16:42:37 +0000 (16:42 +0000)]
Wait queues, allowing conditional sleep in hypervisor context.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agoAdd locking-depth debugging, introduce in_atomic() boolean.
Keir Fraser [Tue, 16 Nov 2010 15:41:28 +0000 (15:41 +0000)]
Add locking-depth debugging, introduce in_atomic() boolean.

This will be useful for debugging use of sleep-in-hypervisor
primitives.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86_64: Make 32-bit-hypercall translate area per-vcpu.
Keir Fraser [Tue, 16 Nov 2010 14:16:36 +0000 (14:16 +0000)]
x86_64: Make 32-bit-hypercall translate area per-vcpu.

This is a prerequisite for allowing guest descheduling within a
hypercall.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86: Clean up vcpu initialisation (especially xsave save area)
Keir Fraser [Tue, 16 Nov 2010 14:09:13 +0000 (14:09 +0000)]
x86: Clean up vcpu initialisation (especially xsave save area)

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agoMake multicall state per-vcpu rather than per-cpu
Keir Fraser [Tue, 16 Nov 2010 13:01:43 +0000 (13:01 +0000)]
Make multicall state per-vcpu rather than per-cpu

This is a prerequisite for allowing guest descheduling within a
hypercall.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86 hvm: Make a couple of hypercall state flags per-vcpu
Keir Fraser [Tue, 16 Nov 2010 12:42:35 +0000 (12:42 +0000)]
x86 hvm: Make a couple of hypercall state flags per-vcpu

This is a prerequisite for allowing guest descheduling within a
hypercall.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86 hvm vpmu: Print error if VPMU cannot be init'ed on this CPU.
Keir Fraser [Tue, 16 Nov 2010 11:44:09 +0000 (11:44 +0000)]
x86 hvm vpmu: Print error if VPMU cannot be init'ed on this CPU.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
15 years agoamd iommu: Fix HV crash with 32bit pv_ops kernel
Keir Fraser [Tue, 16 Nov 2010 11:28:33 +0000 (11:28 +0000)]
amd iommu: Fix HV crash with 32bit pv_ops kernel

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Tested-by: Conny Seidel <conny.seidel@amd.com>
15 years agox2apic: Remove a panic condition in enabling x2APIC
Keir Fraser [Mon, 15 Nov 2010 09:31:38 +0000 (09:31 +0000)]
x2apic: Remove a panic condition in enabling x2APIC

Currently Xen triggers a panic if user disables VT-d by command line
while not disable x2APIC. This requires users to specify both
"iommu=0" and "x2apic=0" to disable VT-d if the platform supports
x2APIC. It's not user friendly. This patch removes the panic
condition. That's to say, don't require user to specify "x2apic=0"
when specify "iommu=0". As long as VT-d is not enabled (disabled in
BIOS or in command line), x2APIC won't be enabled naturally (x2APIC
depends on VT-d Interrupt remapping).

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agox86 xsave: Adding back CPUID support for Xsave (version 2)
Keir Fraser [Mon, 15 Nov 2010 09:27:53 +0000 (09:27 +0000)]
x86 xsave: Adding back CPUID support for Xsave (version 2)

XSave support via CPUID virtualization for both PV and HVM guests.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
15 years agolibxc: correct dirty_bitmap bounce size in xc_hvm_track_dirty_vram
Ian Campbell [Wed, 10 Nov 2010 14:56:06 +0000 (14:56 +0000)]
libxc: correct dirty_bitmap bounce size in xc_hvm_track_dirty_vram

The size should be in bytes not 32-bit words. Fixes graphics
corruption issues for HVM guests due to bouncing too little data.

Also the dirty_bitmap buffer is output only and therefore only needs
bouncing in one direction.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools/hotplug/Linux: supply --physdev-is-bridged in iptables runes
Sander Eikelenboom [Wed, 10 Nov 2010 14:37:19 +0000 (14:37 +0000)]
tools/hotplug/Linux: supply --physdev-is-bridged in iptables runes

With newer (pvops) kernels logs get flooded with this iptables
warning: physdev match: using --physdev-out in the OUTPUT, FORWARD and
POSTROUTING chains for non-bridged traffic is not supported anymore

Using the --physdev-is-bridged option prevents this.
See also: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571634#10

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agohvmloader: Fix 22383:cba667fb80cf iterating over defns 0..255
Keir Fraser [Wed, 10 Nov 2010 14:15:23 +0000 (14:15 +0000)]
hvmloader: Fix 22383:cba667fb80cf iterating over defns 0..255

We need to declare devfn as wider than 8 bits for a loop 0<devfn<256
to terminate.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agohvmloader: fix off-by-one-bit error when initialising PCI devices
Keir Fraser [Wed, 10 Nov 2010 13:58:16 +0000 (13:58 +0000)]
hvmloader: fix off-by-one-bit error when initialising PCI devices

hvmloader is responsible for - amoungst other things - initialising
the PCI device BARs prior to loading the guest BIOS.  The previous
code only probed for devfn up to 128.  The lower 3 bits are function
IDs so this meant that only devices in slots 0-15 were actually being
initialized.

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Acked-by: Gianni Tedesco <gianni.tedesco@citrix.com>
15 years agohvmloader: Fix acpi static tables for new ACPI ioports location.
Keir Fraser [Tue, 9 Nov 2010 20:37:46 +0000 (20:37 +0000)]
hvmloader: Fix acpi static tables for new ACPI ioports location.

This change some fadt values -- the address of the acpi ioports -- and
the pm1a_evt_address value wrote for the pci bus.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
15 years agotools: provide explicit target for refetching/resetting qemu
Ian Campbell [Tue, 9 Nov 2010 18:15:25 +0000 (18:15 +0000)]
tools: provide explicit target for refetching/resetting qemu

This patch adds an explicit update mechanism:
  make tools/ioemu-dir-force-update
This isn't brilliant but is better than doing "cd tools/ioemu-remote
&& git reset --hard <sha1...>" by hand.

Note that invoking this target will destroy all working tree changes
made to qemu-xen.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agofirmware, qemu: Change ACPI IO values to match QEMU BIOS
Anthony Perard [Tue, 9 Nov 2010 18:03:55 +0000 (18:03 +0000)]
firmware, qemu: Change ACPI IO values to match QEMU BIOS

As part of the QEMU/Xen merge, this patch comes to change the value of
sleep states and add some information in the PCI registers to match the
implementation of the BIOS of QEMU.

It also does a hypercall (HVM_PARAM_ACPI_IOPORTS_LOCATION) that tell the
Xen to use the new Port I/O instead of the old one.

[ Also, in this patch, update QEMU_TAG to the qemu-xen revision
  with the corresponding qemu change. -iwj ]

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools: libxl: fix cpuid compilation errors for ia64
KUWAMURA Shin'ya [Tue, 9 Nov 2010 17:43:12 +0000 (17:43 +0000)]
tools: libxl: fix cpuid compilation errors for ia64

ia64 does not have cpuid.  So break out cpuid-related functions into a
separate file, with stubs for ia64.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools: libxl: Fix some "const const"s introduced in 711cb4229900
Ian Jackson [Tue, 9 Nov 2010 12:00:05 +0000 (12:00 +0000)]
tools: libxl: Fix some "const const"s introduced in 711cb4229900

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoia64: fix the build (again)
Keir Fraser [Tue, 9 Nov 2010 11:50:37 +0000 (11:50 +0000)]
ia64: fix the build (again)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: allow passing initrd to kernel without exposing it through the initial mapping
Keir Fraser [Tue, 9 Nov 2010 11:50:14 +0000 (11:50 +0000)]
x86: allow passing initrd to kernel without exposing it through the initial mapping

The (Dom0 only for now) kernel can indicate that it doesn't need its
initrd mapped through a newly added ELF note - it gets passed the PFN
of the initrd in this case instead of the virtual address.

Even for kernels not making use of the new feature, the initrd will
no longer get copied into the initial mapping, but the memory it lives
in will get assigned to and mapped for the guest instead.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: do away with the boot time low-memory 1:1 mapping
Keir Fraser [Tue, 9 Nov 2010 11:49:49 +0000 (11:49 +0000)]
x86: do away with the boot time low-memory 1:1 mapping

By doing so, we're no longer restricted to be able to place all boot
loader modules into the low 1Gb/4Gb (32-/64-bit) of memory, nor is
there a dependency anymore on where the boot loader places the
modules.

We're also no longer restricted to copy the modules into a place below
4Gb, nor to put them all together into a single piece of memory.

Further it allows even the 32-bit Dom0 kernel to be loaded anywhere in
physical memory (except if it doesn't support PAE-above-4G).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86 hvm: Fix MTRR physaddr-width check.
Keir Fraser [Tue, 9 Nov 2010 11:48:43 +0000 (11:48 +0000)]
x86 hvm: Fix MTRR physaddr-width check.

Should be checking against physaddr width presented to teh guest,
rather than the host physaddr width.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agohvmloader: Fix e820 printing routine -- addresses are 64-bit
Keir Fraser [Tue, 9 Nov 2010 10:34:43 +0000 (10:34 +0000)]
hvmloader: Fix e820 printing routine -- addresses are 64-bit

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agolibxc: Save the HVM_PARAM_ACPI_IOPORTS_LOCATION
Anthony Perard [Mon, 8 Nov 2010 17:25:54 +0000 (17:25 +0000)]
libxc: Save the HVM_PARAM_ACPI_IOPORTS_LOCATION

This will save the acpi_ioport_location hvm_param in the checkpoint file
and set the parameter in Xen at restore.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoQEMU_TAG update
Ian Jackson [Mon, 8 Nov 2010 17:14:50 +0000 (17:14 +0000)]
QEMU_TAG update

15 years agotools: xl: more const-correctness
Ian Jackson [Mon, 8 Nov 2010 17:05:14 +0000 (17:05 +0000)]
tools: xl: more const-correctness

The implementation of xl was lacking a lot of consts on its char*s.
In this patch we improve matters.  It doesn't fix everything.  In
particular:

  * I only changed char*s and not other structs that ought to be const.

  * libxl_send_debug_keys should take a const char* but the pointer
    ends up getting sent to DECLARE_HYPERCALL_BOUNCE from xc_private.h
    and that won't take a const char*.  I wasn't sure what to do so
    I have left it.

  * There is a great deal of in-place string tokenisation (both
    ad-hoc, and using strtok_r).  I haven't changed any of that.

  * I haven't changed any of the occurrences of char **argv because of
    the castless assignment incompatibility between const char** and
    char **.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoFix pci passthru in xend interface used by libvirt
Jim Fehlig [Mon, 8 Nov 2010 16:24:22 +0000 (16:24 +0000)]
Fix pci passthru in xend interface used by libvirt

Attempting to define or create a domain whose XML config contains a
passthru PCI device fails with libvirt

xen84: # cat win2k8r2.xml
...
   <hostdev mode='subsystem' type='pci' managed='no'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
    </hostdev>
...

xen84: # virsh create ./win2k8r2.xml
error: Failed to create domain from ./win2k8r2.xml
error: POST operation failed: xend_post: error from xen daemon:
  (xend.err "Error creating domain: 'key'")

The PCI device config maintained by xend includes a 'key' field, which is
initialized by xm client when using that tool and traditional xen config
file.  libvirt, which uses xend's sexpr-over-http interface (is that the
proper name for that interface??), does not initialize this field - and
shouldn't be expected to do so IMO.  Clients should not be bothered with
xend's internal representation of a PCI device.

This patch populates the 'key' field within xend if it is uninitialized,
similar to current initialization of 'uuid' field.  The 'vdevfn' field
suffers a similar problem if not (optionally) specified by user.
AFAICT, the xm client initializes 'vdevfn' to 0x100 if not specified so
I've done the same here.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agox86: xsave save/restore support for both PV and HVM guests (version 2)
Keir Fraser [Mon, 8 Nov 2010 15:44:02 +0000 (15:44 +0000)]
x86: xsave save/restore support for both PV and HVM guests (version 2)

I have tested the patch in the following senarios:
1> Non-xsave platform
2> Xsave-capable platform, guest does not support xsave, xen support xsave
3> Xsave-capable platform, guest does support xsave, xen supports xsave
4> Guest (non-xsave) saved on platform without xsave, restored on a
   Xsave-capable system.

All passed.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Han Weidong <weidong.han@intel.com>
15 years agox86: Fix PV guest xsave support.
Keir Fraser [Mon, 8 Nov 2010 15:41:01 +0000 (15:41 +0000)]
x86: Fix PV guest xsave support.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
15 years agohvmloader: Use ipxe 1.0.0 final rather than a release candidate.
Keir Fraser [Mon, 8 Nov 2010 15:32:55 +0000 (15:32 +0000)]
hvmloader: Use ipxe 1.0.0 final rather than a release candidate.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86-64: more fixes for Fam10 MMCONF enabling
Keir Fraser [Mon, 8 Nov 2010 15:32:05 +0000 (15:32 +0000)]
x86-64: more fixes for Fam10 MMCONF enabling

Unfortunately it turned out the original Linux code had more issues:
We want to place the region above 4G in any case (even if TOM2 isn't
enabled or invalid), and the base mask definition was improperly typed
(thus causing shifts by FAM10H_MMIO_CONF_BASE_SHIFT to produce other
than the intended result). Fixing this in turn allowed simplifying the
MMIO region detection code, as regions ending below TOM2 now aren't of
interest anymore.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agohgignore: Rename gpxe -> ipxe
Keir Fraser [Thu, 4 Nov 2010 16:42:34 +0000 (16:42 +0000)]
hgignore: Rename gpxe -> ipxe

15 years agohvmloader: Replace gPXE with iPXE for ethernet boot ROM
Keir Fraser [Thu, 4 Nov 2010 16:38:13 +0000 (16:38 +0000)]
hvmloader:  Replace gPXE with iPXE for ethernet boot ROM

It is actively maintained.

From: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
15 years agolibelf: move to init text/data when built for the hypervisor
Keir Fraser [Thu, 4 Nov 2010 16:37:29 +0000 (16:37 +0000)]
libelf: move to init text/data when built for the hypervisor

Rather than annotating each and every function and data object (and
then still missing some compiler generated ones, plus getting into
ugliness due to the code also being built from tools/libxc/), use
objcopy to rename all relevant sections.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: clean up AMD Fam10 xenoprof IBS code
Keir Fraser [Thu, 4 Nov 2010 16:36:37 +0000 (16:36 +0000)]
x86: clean up AMD Fam10 xenoprof IBS code

Arrange for (almost) no code to be generated for x86-32, where the
functionality is disabled anyway. Properly __init-annotate the code.
Remove some pointless bits.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86-64: enable MMCONFIG on AMD Fam10 systems even if the BIOS didn't
Keir Fraser [Thu, 4 Nov 2010 16:35:58 +0000 (16:35 +0000)]
x86-64: enable MMCONFIG on AMD Fam10 systems even if the BIOS didn't

Code for this has been in Linux since 2.6.26, and since Xen itself
wants to use the MMCONFIG access method when possible, clone it
(fixing some rather obvious bugs in that code at once).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years ago[VTD] fix a typo and some minor cleanup of quirks.c
Keir Fraser [Thu, 4 Nov 2010 16:35:17 +0000 (16:35 +0000)]
[VTD] fix a typo and some minor cleanup of quirks.c

Fixed a typo for IGD_DEV define and some minor cleanup to ease future
enhancement.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
15 years agox86: Do not expose XSAVE/AVX to guests.
Keir Fraser [Thu, 4 Nov 2010 16:29:47 +0000 (16:29 +0000)]
x86: Do not expose XSAVE/AVX to guests.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agoRevert 22347:16093532f384 "x86: xsave save/restore support"
Keir Fraser [Thu, 4 Nov 2010 16:25:26 +0000 (16:25 +0000)]
Revert 22347:16093532f384 "x86: xsave save/restore support"

Completely broken when xsave is not enabled or supported on the host.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86/mm: tidy up m2p checks in audit_p2m
Keir Fraser [Wed, 3 Nov 2010 17:40:10 +0000 (17:40 +0000)]
x86/mm: tidy up m2p checks in audit_p2m
to handle freshly allocated pages.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agoxenpaging: whitespace fixes after addition of __get_paged_frame
Keir Fraser [Wed, 3 Nov 2010 17:39:23 +0000 (17:39 +0000)]
xenpaging: whitespace fixes after addition of __get_paged_frame

Cleanup whitespace which was introduced in patch that added
__get_paged_frame.
Convert tabs to spaces to follow the coding style in this file.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
15 years agotools: fix cpu_weight/cap loss (22000:4fc66044477d)
Lutz Dube [Wed, 3 Nov 2010 17:23:42 +0000 (17:23 +0000)]
tools: fix cpu_weight/cap loss (22000:4fc66044477d)

Correction/Extension of changeset 22000:4fc66044477d
  "Values of cpu_weight and cpu_cap are lost after xend restart"

Values of cpu_weight and cpu_cap taken from managed SXP file have to
be converted from str to int.

Signed-off-by: Lutz Dube <lutz.dube@ts.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoQEMU_TAG update
Ian Jackson [Wed, 3 Nov 2010 12:51:14 +0000 (12:51 +0000)]
QEMU_TAG update

15 years agolibxc: fix bounce buffers in xc_pm_get_cx_stat and xc_pm_get_pxstat
Ian Campbell [Wed, 3 Nov 2010 12:35:04 +0000 (12:35 +0000)]
libxc: fix bounce buffers in xc_pm_get_cx_stat and xc_pm_get_pxstat

We should bounce the buffers themselves, not the pointers to them!

Error introduced by 22292:a1b39d2b9001 and reported by Yang Z Zhang.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxc, ia64: ia64 counterpart of 22275:e95dc0eb152d and 22285:36a317494429
KUWAMURA Shin'ya [Wed, 3 Nov 2010 12:27:00 +0000 (12:27 +0000)]
libxc, ia64: ia64 counterpart of 22275:e95dc0eb152d and 22285:36a317494429

This patch fixes compilation errors by 22275:e95dc0eb152d:
  ia64/xc_ia64_linux_save.c:797: error: too few arguments to function 'callbacks->switch_qemu_logdirty'
and applies 22285:36a317494429 to ia64.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools: change cpumaps to uint8_t
Juergen Gross [Wed, 3 Nov 2010 12:10:46 +0000 (12:10 +0000)]
tools: change cpumaps to uint8_t

Cpumap types in tools (libxc and libxl) are changed to be based on bytes like
in the interface to the hypervisor.
To make handling easier the size of used cpumaps is always based on the
number of physical cpus supported by the hypervisor. This eliminates the need
to keep track of the cpumap size in external interfaces.
In libxl a macro for cycling through a cpumap is added (libxl_for_each_cpu).

Interfaces changed:
libxl_set_vcpuaffinity()
libxl_cpumap_alloc()
xc_vcpu_setaffinity()
xc_vcpu_getaffinity()
xc_cpupool_freeinfo()

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools: gdbsx: Check return of write()
Ian Jackson [Wed, 3 Nov 2010 11:58:25 +0000 (11:58 +0000)]
tools: gdbsx: Check return of write()

Not checking leads to warn_unused_result checks triggering in some
libraries and compilers.  Combined with -Werror this breaks the build.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoVT-d: fix device assignment failure (regression from Xen c/s 19805:2f1fa2215e60)
Keir Fraser [Wed, 3 Nov 2010 08:18:51 +0000 (08:18 +0000)]
VT-d: fix device assignment failure (regression from Xen c/s 19805:2f1fa2215e60)

If the device at <secbus>:00.0 is the device the mapping operation was
initiated for, trying to map it a second time will fail, and hence
this second mapping attempt must be prevented (as was done prior to
said c/s).

While at it, simplify the code a little, too.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Weidong Han <weidong.han@intel.com>
15 years agox86: xsave save/restore support for both PV and HVM guests.
Keir Fraser [Wed, 3 Nov 2010 08:17:39 +0000 (08:17 +0000)]
x86: xsave save/restore support for both PV and HVM guests.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Han Weidong <weidong.han@intel.com>
15 years agox86 hvm: exposes AVX to guest.
Keir Fraser [Wed, 3 Nov 2010 08:16:47 +0000 (08:16 +0000)]
x86 hvm: exposes AVX to guest.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Han Weidong <weidong.han@intel.com>
15 years agox86: Xsave support for PV guests.
Keir Fraser [Wed, 3 Nov 2010 08:15:20 +0000 (08:15 +0000)]
x86: Xsave support for PV guests.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Han Weidong <weidong.han@intel.com>
15 years agoFix ia64 tools build
Keir Fraser [Tue, 2 Nov 2010 07:35:52 +0000 (07:35 +0000)]
Fix ia64 tools build

22066:eccfdeb41b80 replaced tools/libxc/ia64/aclinux.h with
xen/include/acpi/platform/aclinux.h.
Because both are incompatible, tools cannot be built on ia64.

This patch fixes compilation errors by defining identifiers at
ac_ia64_tools.h.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agolibxl: fix build since 22325:4ac03710fc32
Gianni Tedesco [Mon, 1 Nov 2010 18:13:31 +0000 (18:13 +0000)]
libxl: fix build since 22325:4ac03710fc32

"libxl: Fix migration of HVM guests" introduces a stat call without
including <sys/stat.h>

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agox86 hvm: Fixes for 22339:6fae4331d5aa
Keir Fraser [Mon, 1 Nov 2010 14:11:28 +0000 (14:11 +0000)]
x86 hvm: Fixes for 22339:6fae4331d5aa

Primarily fix up register names in public header file for
compatibility with old unmodified versions of virtual firmware and
qemu-dm. Also fixes a bug in the read case of handle_evt_io().

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86_emulate: Fix build with some versions of gcc targeting i386.
Keir Fraser [Sun, 31 Oct 2010 19:01:33 +0000 (19:01 +0000)]
x86_emulate: Fix build with some versions of gcc targeting i386.

Signed-off-by: Keir Fraser <keir@xen.org>
15 years agoi386: simplify pte_read_atomic()
Keir Fraser [Fri, 29 Oct 2010 17:43:01 +0000 (18:43 +0100)]
i386: simplify pte_read_atomic()

There's no need for a loop here: if the value to be compared against
and the value to be stored are equal, cmpxchg{,8b} act just like a
load anyway.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86 hvm: Introduce pmtimer_change_ioport and HVM_PARAM_ACPI_IOPORTS_LOCATION
Keir Fraser [Fri, 29 Oct 2010 17:42:34 +0000 (18:42 +0100)]
x86 hvm: Introduce pmtimer_change_ioport and HVM_PARAM_ACPI_IOPORTS_LOCATION

By default, Xen will handle the old ACPI IO port. But it can switch to
the new one by setting the HVM_PARAM_ACPI_IOPORTS_LOCATION to 1.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
15 years agox86 hvm: Introduce unregister_io_handler
Keir Fraser [Fri, 29 Oct 2010 17:14:01 +0000 (18:14 +0100)]
x86 hvm: Introduce unregister_io_handler

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
15 years agoVT-d: only scan secondary functions on multi-function devices
Keir Fraser [Fri, 29 Oct 2010 17:06:17 +0000 (18:06 +0100)]
VT-d: only scan secondary functions on multi-function devices

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoXen: fix various checks of unsigned integers < 0
Keir Fraser [Fri, 29 Oct 2010 17:05:50 +0000 (18:05 +0100)]
Xen: fix various checks of unsigned integers < 0

Some of these could be benignly discarded by the compiler but some are
actual bugs.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agoACPI: fix typo
Keir Fraser [Fri, 29 Oct 2010 17:05:27 +0000 (18:05 +0100)]
ACPI: fix typo

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agox86: Clean up existing XSAVE support
Keir Fraser [Fri, 29 Oct 2010 17:04:46 +0000 (18:04 +0100)]
x86: Clean up existing XSAVE support

Signed-off-by: Han Weidong <weidong.han@intel.com>
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
15 years agoX86: Prefer TSC-deadline timer in Xen
Keir Fraser [Fri, 29 Oct 2010 09:40:14 +0000 (10:40 +0100)]
X86: Prefer TSC-deadline timer in Xen

The new TSC Deadline Timer offers system software a low overhead
per-logical-thread deadline timer in TSC units.

The timer is implemented via a new architectural 64-bit register,
IA32_TSC_DEADLINE_MSR. Reads and writes of this MSR occur in program
order, but are non-serializing.

The support for this feature is indicated by
CPUID.01H:ECX.TSC_Deadline[bit 24] =3D 1 as documented in the Intel
Architecture Software Developer's Manual.

The LOCAL APIC on new processors has a mode where its underlying
hardware timer can now be accessed via the non-serializing
IA32_TSC_DEADLINE_MSR in TSC tick units.

If this mode is present, prefer it over the traditional LAPIC timer
mode.  KERN_DEBUG dmesg will print "TSC deadline timer enabled" when
TDT is used.

Bootparam "tdt=off" is available to revert to LAPIC timer mode.

This patch is based on original work by Len Brown for Linux kernel.

cc: Len Brown <len.brown@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
15 years agovtd: consolidate VT-d quirks into a single file quirks.c
Keir Fraser [Fri, 29 Oct 2010 09:29:14 +0000 (10:29 +0100)]
vtd: consolidate VT-d quirks into a single file quirks.c

Consolidate VT-d quirks into a single file - quirks.c.  This includes
quirks to workaround OEM BIOS issue with VT-d enabling in IGD, Cantiga
VT-d buffer flush issue, Cantiga IGD Vt-d low power related errata,
and a quirk to workaround issues related to wifi direct assignment.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Reviewed-by: Jan Beulich <JBeulich@novell.com>
15 years agocredit2: Trace and debug key tweaks
Keir Fraser [Fri, 29 Oct 2010 09:20:33 +0000 (10:20 +0100)]
credit2: Trace and debug key tweaks

* Add traces for credit reset and scheduling a tasklet
* Remove tsc for traces which probably don't need them
* Print domain info in the debug dump

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agocredit2: Fix runq_tickle to use idle, tickled masks
Keir Fraser [Fri, 29 Oct 2010 09:20:08 +0000 (10:20 +0100)]
credit2: Fix runq_tickle to use idle, tickled masks

The previous code had a bug where, if a second vcpu woke up and ran
runq_tickle before the first vcpu had actually started running on a
tickled processor, the code would choose the same cpu to tickle, and
the result would be a "missed tickle" -- only one of the vcpus would
run, despite having idle processors.

This change:
* Keeps a mask of idle cpus
* Keeps a mask of cpus which have been tickled, but not entered
schedule yet.

The new tickle code first looks at the set of idle-but-not-tickled
cpus; if it's not empty, it tickles one.

If that doesn't work, it looks at the set of not-idle-but-not-tickled
cpus, finds the one with the lowest credit; if that's lower than the
waking vcpu, it tickles that one.

If any cpu is tickled, its bit in the tickled mask is set, and cleared
when schedule() is called.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agocredit2: Make fake runq map initilization explicit
Keir Fraser [Fri, 29 Oct 2010 09:19:30 +0000 (10:19 +0100)]
credit2: Make fake runq map initilization explicit

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agohvmloader: Configure gPXE to use serial console
Keir Fraser [Fri, 29 Oct 2010 09:17:07 +0000 (10:17 +0100)]
hvmloader: Configure gPXE to use serial console

Sometimes we would rather connect to an HVM's serial console than it's
VGA display. In this case we cannot see or interact with the ethernet
booting process. This is a bit annoying so let's just enable it.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
15 years agoQEMU_TAG update
Ian Jackson [Thu, 28 Oct 2010 11:28:49 +0000 (12:28 +0100)]
QEMU_TAG update

15 years agoavoid numa placement of cpus with active cpupools
Juergen Gross [Thu, 28 Oct 2010 11:22:09 +0000 (12:22 +0100)]
avoid numa placement of cpus with active cpupools

When using cpupools don't pin vcpus to numa nodes as this might
conflict with the cpupool definition.
numa placement should be handled by cpupool configuration instead.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: Fix migration of HVM guests
Ian Campbell [Thu, 28 Oct 2010 11:19:43 +0000 (12:19 +0100)]
libxl: Fix migration of HVM guests

In the default "QemuDeviceModelRecord"-style HVM tail of the migration
protocol the size of the qemu save record is unknown at the receiver
and therefore it must read until EOF. This is not compatible with the
xl migration protocol which contains a post-migration handshake and
therefore cannot close the socket on the sending end.

What is required is an explicit length field for the save record,
which the "RemusDeviceModelState"-style HVM tail includes.

Rather than overload the "RemusDeviceModelState" name for a non-Remus
use case (on off chance that they need to diverge for some reason in
the future) introduce a third style called "DeviceModelRecord0002"
which is identical to current "RemusDeviceModelState"-style.

Hopefully the inclusion of a number here will allow easier extension
in the future without needing to come up with increasingly less
helpful names!

Also propagate errors from xc_domain_save and
libxl__domain_suspend_common to callers.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: support -w (wait) option in xl shutdown
Ian Campbell [Thu, 28 Oct 2010 11:16:48 +0000 (12:16 +0100)]
xl: support -w (wait) option in xl shutdown

improves compatibility with xm.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools: caml-stubdom: fix "red zone" bug
Patrick Colp [Thu, 28 Oct 2010 11:15:41 +0000 (12:15 +0100)]
tools: caml-stubdom: fix "red zone" bug

According to the AMD64 ABI, the 128-byte area below %rsp is reserved
for scratch space and should not be used by signal, interrupt, or
exception handlers. However, Mini-OS does not adhere to this
interface. As a result, the -mno-red-zone flag must be provided to gcc
in order to force code to be compiled without this assumption. In the
case of the c-stubdom or the ioemu stubdom, Makefile configuration and
flags are inherited from Xen, which includes this flag. However, in
the case of the ocaml stubdom, since an independent ocaml version is
pulled and compiled, with its own make system in place, this flag is
not present.

As a default optimisation (no optimisation flags specified), gcc
generates function header code that uses mov instead of push (to save
a few instructions). However, with the 128-byte scratch space
assumption in place, registers are moved onto the stack *before* %rsp
is updated. This results in cases where when a function is being
called, *after* the first mov <foo>, <offset>(%rsp) but *before* the
%rsp update, sub <bar>, %rsp, if an interrupt is fired, then the stack
will be clobbered (as Mini-OS uses the application stack for its
stack, pushing registers onto the stack on entry and popping them off
on exit).

This patch fixes this issue by passing the -mno-red-zone flag to the
ocaml configure script in the stubdom Makefile.

Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: Fix format string abuses / vulnerabilities
Ian Jackson [Thu, 28 Oct 2010 11:05:45 +0000 (12:05 +0100)]
libxl: Fix format string abuses / vulnerabilities

There are a few places where libxl__xs_write is passed a variable
value to write to xenstore, but the semantics are that the first char*
is a format string.  So use "%s".

This fixes the following errors reported by some newer compilers:
 libxl.c: In function "libxl_create_cpupool":
 libxl.c:3981: error: format not a string literal and no format arguments
 libxl.c:3983: error: format not a string literal and no format arguments
 libxl.c: In function "libxl_cpupool_movedomain":
 libxl.c:4095: error: format not a string literal and no format arguments

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Gianni Tedesco <gianni.tedesco@citrix.com>
15 years agolibxl: fix dom0 minimum memory threshold check
Gianni Tedesco [Thu, 28 Oct 2010 11:02:22 +0000 (12:02 +0100)]
libxl: fix dom0 minimum memory threshold check

libxl_set_memory_target tries to set the memory target for a given
domain to new_target_memkb. The function includes a check to make sure
that dom0's memory is not reduced below a minimal threshold ie.
LIBXL_MIN_DOM0_MEM. However, this check is performed before the
new_target_memkb variable is properly initialised - when the value is
always zero. This means that the check always fails. Fix this by moving
the test to happen after the proper initialisation of new_target_memkb.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agogdbsx: Makefiles: correctly generate dependencies
Gianni Tedesco [Thu, 28 Oct 2010 10:47:26 +0000 (11:47 +0100)]
gdbsx: Makefiles: correctly generate dependencies

gdbsx hacks CFLAGS to remove optimisations for easier debugging, however
this breaks dep generation due to an early evaluation of CFLAGS and
leaves stale files called "..d" after a make clean. We could possibly
fix this by separating dep generation from the rest of CFLAGS but it
seems a little invasive. The gdbsx hackers can do their own thing during
development and testing anyway...

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
15 years agoocaml: Makefile: delete dependency files during make clean
Gianni Tedesco [Thu, 28 Oct 2010 10:46:20 +0000 (11:46 +0100)]
ocaml: Makefile: delete dependency files during make clean

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools: Makefile: delete qemu during make distclean
Gianni Tedesco [Thu, 28 Oct 2010 10:45:54 +0000 (11:45 +0100)]
tools: Makefile: delete qemu during make distclean

The top-level makefile claims this to be the expected behaviour so make
it so.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: Makefile: delete temporary files during make clean
Gianni Tedesco [Thu, 28 Oct 2010 10:45:09 +0000 (11:45 +0100)]
libxl: Makefile: delete temporary files during make clean

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoblktap2: Makefiles: delete symlinks and deps during make clean
Gianni Tedesco [Thu, 28 Oct 2010 10:44:17 +0000 (11:44 +0100)]
blktap2: Makefiles: delete symlinks and deps during make clean

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoDo not wait for memory teardown when live migrate
Miroslav Rezanina [Thu, 28 Oct 2010 10:40:32 +0000 (11:40 +0100)]
Do not wait for memory teardown when live migrate

When trying to live migrate guest with great memory (e.g. 20 GB),
there's delay caused by destroying source copy of domain.  To speed up
this process we can close socket before starting guest destroy, as
source guest is not running anymore.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxc: fix xc_version by handling all known command types.
Ian Campbell [Wed, 27 Oct 2010 11:24:28 +0000 (12:24 +0100)]
libxc: fix xc_version by handling all known command types.

xend was crashing since 22289:ca4a781c8ae8 due to missing handling of
XENVER_commandline.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
15 years agoMerge
Ian Jackson [Tue, 26 Oct 2010 11:22:52 +0000 (12:22 +0100)]
Merge

15 years ago"kdd" Windows debugger stub.
Tim Deegan [Tue, 26 Oct 2010 10:56:31 +0000 (11:56 +0100)]
"kdd" Windows debugger stub.

kdd runs in dom0, attaches to a domain and speaks the Windows kd serial
protocol over a TCP connection (which should go to kd or windbg, e.g.
by having another VM with its virtual COM1 set up as a TCP listener).

It doesn't do breakpoints &c yet, and windbg can get quite confused
since the kernel debugger's not actually running, but it's good enough
to extract backtraces from wedged VMs.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agolibxc: correct handling of switch_qemu_logdirty callback return value
Ian Campbell [Mon, 25 Oct 2010 17:15:28 +0000 (18:15 +0100)]
libxc: correct handling of switch_qemu_logdirty callback return value

The callback return convention follows xc_domain_save and therefore
returns 0 on success and >0 on error, correct the check accordingly.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agohvmloader: reduce iasl verbosity
Keir Fraser [Sun, 24 Oct 2010 12:18:26 +0000 (13:18 +0100)]
hvmloader: reduce iasl verbosity

I don't think anyone really needs iasl's banner displayed during the
build process.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoia64: fix build in grant table and tmem code
Keir Fraser [Sun, 24 Oct 2010 12:17:42 +0000 (13:17 +0100)]
ia64: fix build in grant table and tmem code

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: enable support for {rd,wr}{fs,gs}base instructions
Keir Fraser [Sun, 24 Oct 2010 12:17:07 +0000 (13:17 +0100)]
x86: enable support for {rd,wr}{fs,gs}base instructions

... so that once in a while Xen knows of a new CPU feature before
Linux starts making use of it.

While (obviously) I wasn't able to test this, it seemed strait forward
enough to enable anyway.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: delete not really used ioapic_renumber_irq variable
Keir Fraser [Sun, 24 Oct 2010 12:15:48 +0000 (13:15 +0100)]
x86: delete not really used ioapic_renumber_irq variable

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86/kexec: fix very old regression and make compatible with modern Linux
Keir Fraser [Sun, 24 Oct 2010 12:15:06 +0000 (13:15 +0100)]
x86/kexec: fix very old regression and make compatible with modern Linux

c/s 13829 lost the (32-bit only) cpu_has_pae argument passed to the
primary kernel's stub (in the 32-bit Xen case only), and Linux
2.6.27/.30 (32-/64-bit) introduced a new argument (for KEXEC_JUMP)
which for now simply gets passed a hardcoded value.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoAllow max_pages to be set to less than tot_pages
Keir Fraser [Sun, 24 Oct 2010 12:13:04 +0000 (13:13 +0100)]
Allow max_pages to be set to less than tot_pages

The memory allocation code sometimes needs to enforce that a guest
that's been told to balloon down isn't going to expand further
(because it's still executing a previous balloon-up operation).  That
means being able to set the desired max_pages even before the balloon
driver has brought tot_pages down to the right level.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agocpupools: Make interface more consistent
Keir Fraser [Sun, 24 Oct 2010 12:09:50 +0000 (13:09 +0100)]
cpupools: Make interface more consistent

The current cpupools code interface is a bit inconsistent.  This
patch addresses this by making the interaction for each
vcpu in a pool look like this:

alloc_vdata() -- allocates and sets up vcpu data
insert_vcpu() -- the vcpu is ready to run in this pool
remove_vcpu() -- take the vcpu out of the pool
free_vdata()  -- delete allocated vcpu data

(Previously, remove_vcpu and free_vdata were combined into a "destroy
vcpu", and insert_vcpu was only called for idle vcpus.)

This also addresses a bug in credit2 which was caused by a
misunderstanding of the cpupools interface.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
15 years agolibxc: finalise transition to hypercall buffers.
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: finalise transition to hypercall buffers.

Rename xc_set_xen_guest_handle to set_xen_guest_handle[0] and remove now
unused functions:
  - xc_memalign
  - lock_pages
  - unlock_pages
  - hcall_buf_prep
  - hcall_buf_release

[0] sed -i -e 's/xc_set_xen_guest_handle/set_xen_guest_handle/g' \
tools/libxc/*.[ch] \
tools/python/xen/lowlevel/xc/xc.c \
tools/python/xen/lowlevel/acm/acm.c \
tools/libxc/ia64/xc_ia64_stubs.c \
tools/security/secpol_tool.c \
tools/misc/xenpm.c

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
15 years agolibxc: do not align/lock buffers which do not need it
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: do not align/lock buffers which do not need it

On restore:

region_mfn is passed to xc_map_foreign_range and
xc_map_foreign_bulk. In both cases the buffer is accessed from the
ioctl handler in the kernel and not from any hypercall. Therefore
normal copy_{to,from}_user handling in the kernel will cope with any
faulting access.

p2m_batch is passed to xc_domain_memory_populate_physmap which takes
care of bouncing the buffer already.

On save:

pfn_type is passed to xc_map_foreign_bulk which does not need locking
as per region_mfn above.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
15 years agosecpol: use hypercall buffers
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
secpol: use hypercall buffers

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>